package com.weilx959.spt.app.plugin;

import com.weilx959.spt.app.controller.HomeViewController;
import com.weilx959.spt.app.utils.ResourceBundleUtil;
import com.weilx959.spt.core.interfaces.Controller;
import com.weilx959.spt.core.interfaces.SPTPlugin;
import com.weilx959.spt.core.utils.FXMLUtil;
import javafx.scene.Node;

import java.util.ResourceBundle;

public class HomePluginImpl implements SPTPlugin {
    private final HomeViewController controller;

    private final ResourceBundle bundle;

    public HomePluginImpl() {
        bundle = ResourceBundleUtil.get();
        controller = FXMLUtil.getController("com/weilx959/spt/app/home-view.fxml", bundle);
    }

    @Override
    public String getID() {
        return "1ea37303-9630-48a1-b739-3b1931bec0ea";
    }

    @Override
    public String getName() {
        return bundle.getString("app.home.name");
    }

    @Override
    public String getDescription() {
        return bundle.getString("app.home.description");
    }

    @Override
    public String getIconStyle() {
        return "home";
    }

    @Override
    public String getVersion() {
        return bundle.getString("app.home.version");
    }

    @Override
    public String getAuthor() {
        return bundle.getString("app.home.author");
    }

    @Override
    public Controller getController() {
        return controller;
    }

    @Override
    public Node getView() {
        return controller.getRootPane();
    }

    @Override
    public Integer getOrder() {
        return 0;
    }
}
